package File;

import java.io.*;

public class Demo21 {
    public static void main(String[] args) throws IOException {
//        FileWriter writer=new FileWriter("src\\File\\test.txt",true);
//writer.write("这是一个FileWriter操作");
//
//        for (int i = 0; i < 5; i++) {
//            writer.write("这是一个FileWriter操作\n",2,3);
//        }
//
//writer.close();


//        PrintWriter writer=new PrintWriter("src\\File\\test.txt");
//        writer.println("hhhhhhhcnm");
//        writer.close();


//        FileReader reader=new FileReader("src\\File\\test.txt");
//        char[]c=new char[30];
//int count=-1;
//while((count= reader.read(c))!=-1){
//    System.out.println(new String(c,0,count));
//}
//reader.close();

        FileReader fileReader=new FileReader("src\\File\\test.txt");
        BufferedReader reader=new BufferedReader(fileReader);
int count=-1;

//        String str= reader.readLine();
//        System.out.printf(str);
        String str;
        while((str= reader.readLine())!=null){
            System.out.println(str);
        }
reader.close();
    }
}
